<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>条件运算符</title>
</head>
<body>
<script>
    var a = 39;
    var b = 30;
    document.write(a>=b ? "a大于等于b" : "a小于b");//a大于等于b
    var age = 12;
    var msg = age>18 ? "成年人" : "未成年";
    console.log(msg);//未成年

</script>
</body>
</html>